package com.day0426.validate;/*
 * @创建者：黄苟苟
 * @创建时间：2021/4/26   11:48
 * @Description描述
 **/

public class GenericValidate implements Validate {
    /*
    * 设置相关变量
    * */
    private Object[] inner;
    private Object input;
    /*
    * 构造方法，初始化对象属性
    * */

    public GenericValidate(Object[] inner, Object input) {
        this.inner = inner;
        this.input = input;
    }

    @Override
    public boolean check() {
        for (int i = 0; i <this.getInner().length ; i++) {
            if (this.getInput()!=null&&this.getInput().equals(this.getInner()[i])){
                return true;
            }
        }
        return false;
    }

    public Object[] getInner() {
        return inner;
    }

    public void setInner(Object[] inner) {
        this.inner = inner;
    }

    public Object getInput() {
        return input;
    }

    public void setInput(Object input) {
        this.input = input;
    }
}
